import request from '@/utils/request'

export default {
  tree(params) {
    return request({
      url: '/v1/categoryTree',
      method: 'get',
      params
    })
  },
  newTree(params) {
    return request({
      url: '/v1/PositionTree',
      method: 'get',
      params
    })
  },
  getList(params) {
    return request({
      url: '/v1/equipmentList',
      method: 'get',
      params
    })
  },
  getOne(id) {
    return request({
      url: `/v1/equipment/${id}`,
      method: 'get'
    })
  },
  create(data) {
    return request({
      url: '/v1/equipmentAdd',
      method: 'post',
      data
    })
  },
  update(data) {
    return request({
      url: '/v1/equipmentUpdate',
      method: 'post',
      data
    })
  },
  delete(id) {
    return request({
      url: `/v1/equipmentDel/${id}`,
      method: 'get'
    })
  },
  eqPlanAdminSave(data) {
    return request({
      url: '/v1/eqAdd',
      method: 'post',
      data
    })
  },
  renew(id) {
    return request({
      url: `/v1/eqRenew/${id}`,
      method: 'get'
    })
  },
  categoryTree() {
    return request({
      url: '/v1/categoryTree',
      method: 'get'
    })
  },
  positionTree() {
    return request({
      url: '/v1/positionTree',
      method: 'get'
    })
  },
  append(data) {
    return request({
      url: '/v1/eqAdminAppend',
      method: 'post',
      data
    })
  },
  remove(data) {
    return request({
      url: '/v1/eqAdminRemove',
      method: 'post',
      data
    })
  },
  appendAdmin(data) {
    return request({
      url: '/v1/equipmentAppendAdmin',
      method: 'post',
      data
    })
  },
  removeAdmin(id) {
    return request({
      url: `/v1/equipmentRemoveAdmin/${id}`,
      method: 'get'
    })
  },
  appendEngineer(data) {
    return request({
      url: '/v1/equipmentAppendEngineer',
      method: 'post',
      data
    })
  },
  removeEngineer(id) {
    return request({
      url: `/v1/equipmentRemoveEngineer/${id}`,
      method: 'get'
    })
  },
  excel(data) {
    return request({
      url: '/v1/equipmentImport',
      method: 'post',
      data
    })
  }
}
